package com.genesis.yunnanji.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.genesis.yunnanji.R;
import com.genesis.yunnanji.bean.SupBean;
import com.genesis.yunnanji.config.GenesisApiConfig;
import com.lidroid.xutils.BitmapUtils;

import java.util.List;

/**
 * 体验馆详情评论
 */

public class SupDiscussAdapter extends BaseQuickAdapter<SupBean.ResultBean.ProductBean, BaseViewHolder> {
    private Context context;

    public SupDiscussAdapter(Context context, @Nullable List<SupBean.ResultBean.ProductBean> data) {
        super(R.layout.layout_supspecail_item, data);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, SupBean.ResultBean.ProductBean item) {

        BitmapUtils bitmapUtils = new BitmapUtils(context);
        bitmapUtils.display((ImageView) helper.getView(R.id.iv_supspecial_iv), GenesisApiConfig.PIC_HOST + item.getCover_img());

        helper.setText(R.id.tv_supspecial_tv, item.getTitle());

    }
}
